﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;

namespace CSharpNewFeaturesUse
{
    public class Spread
    {
        public static void ShowUse()
        {
            int[] row0 = [1, 2, 3];
            List<int> row1 = [4, 5, 6];
            Collection<int> row2 = [7, 8, 9];
            // 只要是集合类型就都可以展开
            test([.. row0, .. row1, .. row2]);
        }
        private static void test(int[] single)
        {
            foreach (var element in single)
            {
                Console.Write($"{element}, ");
            }
            Console.WriteLine();
        }
    }
}